package com.bazaaroid.server.gae.core.dto;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.bazaaroid.server.gae.core.persistence.model.User;
import com.bazaaroid.server.gae.security.enums.Authorities;

@XmlRootElement(name = "User")
public class UserDTO {

	private User user = null;

	public UserDTO(){}

	public UserDTO(User user) {
		this.user = user;
	}

	@XmlElement
	public String getKey() {
		return user.getKey().toString();
	}

	@XmlElement
	public String getUsername() {
		return user.getUsername();
	}

	@XmlElement
	public String getPassword() {
		return user.getPassword();
	}

	@XmlElement
	public String getType() {
		return Authorities.getAuthorityFromValue(user.getType());
	}
	
}
